'\" t
.\"     Title: 
    mkbingram
  
.\"    Author: 
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
.\"      Date: 12/19/2013
.\"    Manual: 
.\"    Source: 
.\"  Language: English
.\"
.TH "MKBINGRAM" "1" "12/19/2013" ""
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"

    mkbingram
   \- make binary N\-gram from ARPA N\-gram file
.SH "SYNOPSIS"
.HP \w'\fBmkbingram\fR\ 'u
\fBmkbingram\fR [\-nlr\ \fIforward_ngram\&.arpa\fR] [\-nrl\ \fIbackward_ngram\&.arpa\fR] [\-d\ \fIold_bingram_file\fR] {output_bingram_file}
.SH "DESCRIPTION"
.PP

\fBmkbingram\fR
is a tool to convert N\-gram definition file(s) in ARPA standard format to a compact Julius binary format\&. It will speed up the initial loading time of N\-gram much faster\&. It can read gzipped file directly\&.
.PP
From rev\&.4\&.0, Julius can deal with forward N\-gram, backward N\-gram and their combinations\&. So,
\fBmkbingram\fR
now generates binary N\-gram file from one of them, or combining them two to produce one binary N\-gram\&.
.PP
When only a forward N\-gram is specified,
\fBmkbingram\fR
generates binary N\-gram from only the forward N\-gram\&. When using this binary N\-gram at Julius, it performs the 1st pass with the 2\-gram probabilities in the N\-gram, and run the 2nd pass with the given N\-gram fully, with converting forward probabilities to backward probabilities by Bayes rule\&.
.PP
When only a backward N\-gram is specified,
\fBmkbingram\fR
generates an binary N\-gram file that contains only the backward N\-gram\&. The 1st pass will use forward 2\-gram probabilities that can be computed from the backward 2\-gram using Bayes rule, and the 2nd pass use the given backward N\-gram fully\&.
.PP
When both forward and backward N\-grams are specified, the 2\-gram part in the forward N\-gram and all backward N\-gram will be combined into single bingram file\&. The forward 2\-gram will be applied for the 1st pass and backward N\-gram for the 2nd pass\&. Note that both N\-gram should be trained in the same corpus with same parameters (i\&.e\&. cut\-off thresholds), with same vocabulary\&.
.PP
The character code in binary N\-gram can be converted from version 4\&.2\&.3 or later
.PP
The old binary N\-gram produced by
\fBmkbingram\fR
of version 3\&.x and earlier can be used in Julius\-4, but you can convert the old version to the new version by specifying it as input of current
\fBmkbingram\fR
by option "\fB\-d\fR"\&.
.PP
Please note that binary N\-gram file converted by
\fBmkbingram\fR
of version 4\&.0 and later cannot be read by older Julius 3\&.x\&.
.SH "OPTIONS"
.PP
\fB \-nlr \fR \fIforward_ngram\&.arpa\fR
.RS 4
Read in a forward (left\-to\-right) word N\-gram file in ARPA standard format\&.
.RE
.PP
\fB \-nrl \fR \fIbackward_ngram\&.arpa\fR
.RS 4
Read in a backward (right\-to\-left) word N\-gram file in ARPA standard format\&.
.RE
.PP
\fB \-d \fR \fIold_bingram_file\fR
.RS 4
Read in a binary N\-gram file\&.
.RE
.PP
\fB \-swap \fR
.RS 4
Swap BOS word <s> and EOS word </s> in N\-gram\&.
.RE
.PP
\fB \-c \fR \fIfrom to\fR
.RS 4
Convert character code in binary N\-gram\&. ("from", "to" are string that intend character code)
.RE
.PP
\fIoutput_bingram_file\fR
.RS 4
binary N\-gram file name to output\&.
.RE
.SH "EXAMPLES"
.PP
Convert a set of forward and backward N\-gram in ARPA format into Julius binary form:
.sp .if n \{\ .RS 4 .\} .nf % \fBmkbingram\fR \-nlr 2gram\&.arpa \-nrl rev\-Ngram\&.arpa outfile .fi .if n \{\ .RE .\}
Convert a single forward 4\-gram in ARPA format into a binary file:
.sp .if n \{\ .RS 4 .\} .nf % \fBmkbingram\fR \-nlr 4gram\&.arpa outfile .fi .if n \{\ .RE .\}
Convert old binary N\-gram file to current format:
.sp .if n \{\ .RS 4 .\} .nf % \fBmkbingram\fR \-d old_bingram new_bingram .fi .if n \{\ .RE .\}
.SH "SEE ALSO"
.PP

\fB julius \fR( 1 )
,
\fB mkbinhmm \fR( 1 )
,
\fB mkbinhmmlist \fR( 1 )
.SH "COPYRIGHT"
.PP
Copyright (c) 1991\-2013 Kawahara Lab\&., Kyoto University
.PP
Copyright (c) 1997\-2000 Information\-technology Promotion Agency, Japan
.PP
Copyright (c) 2000\-2005 Shikano Lab\&., Nara Institute of Science and Technology
.PP
Copyright (c) 2005\-2013 Julius project team, Nagoya Institute of Technology
.SH "LICENSE"
.PP
The same as Julius\&.
